<template>
  <!-- 排名变化 -->
  <div class="box">
    <div class="img_banner">
      <van-swipe
        :autoplay="3000"
        style="width:100%;height:100%"
      >
        <van-swipe-item
          v-for="(image, index) in images"
          :key="index"
        >
          <img v-lazy="image.bander_img" />
        </van-swipe-item>
      </van-swipe>
    </div>
    <van-grid
      :border="false"
      :column-num="3"
      class="grid"
    >
      <van-grid-item to="/personaldata">
        <img src="@/static/images/statistics/PersonalData.png" />
        <span>个人数据</span>
      </van-grid-item>
      <van-grid-item to="/rankingChange">
        <img src="@/static/images/statistics/RankingChange.png" />
        <span>排名变化</span>
      </van-grid-item>
      <van-grid-item to='/integralChange'>
        <img src="@/static/images/statistics/IntegralChange.png" />
        <span>积分变化</span>
      </van-grid-item>
      <van-grid-item to='/departmentalStatistics'>
        <img src="@/static/images/statistics/DeptData.png" />
        <span>部门数据</span>
      </van-grid-item>
      <van-grid-item to="/progress">
        <img src="@/static/images/statistics/ProgressAward.png" />
        <span>进步数据</span>
      </van-grid-item>
      <van-grid-item to='/fabulous'>
        <img src="@/static/images/statistics/Appreciate.png" />
        <span>点赞数统计</span>
      </van-grid-item>
      <van-grid-item to='/TaskStatistics'>
        <img src="@/static/images/statistics/TaskStatistics.png" />
        <span>奖扣任务统计</span>
      </van-grid-item>
    </van-grid>
  </div>
</template>

<script type="text/javascript">
import { Grid, GridItem, Swipe, SwipeItem } from "vant";
export default {
  data() {
    return {
     images: [
         {bander_img:""},
         {bander_img:""},
       ]
    };
  },

  created() {
    this.show_Rotation_chart();
    dd.biz.navigation.setTitle({
      title: "数据统计" //控制标题文本，空字符串表示显示默认文本
    });
  },
  methods: {
    async show_Rotation_chart() {
      let userId = localStorage.getItem("userId");
        let corpId = localStorage.getItem("custid");
      // let corpId = this.$utils.getUrlKey("custid");
      const res = await this.$http.get(
        `yuepoints/getRotationPicture?corpId=${corpId}&userId=${userId}&type=6`
      );
      if(res.data.data.length!=0){
          this.images = res.data.data;
      }
      // console.log(res.data.data)
    
    }
  },
  components: {
    [Grid.name]: Grid,
    [GridItem.name]: GridItem,
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem
  }
};
</script>

<style lang="less" scoped>
.box {
  margin: 0px;
  padding: 0px;
  .img_banner {
    // padding: 10px;
    height: 180px;
    width: 100%;
    img {
      height: 100%;
      width: 100%;
    }
  }
  // /deep/ .van-grid-item__content {
  //     background: #fafafa;
  // }
  .grid {
    img {
      height: 30px;
    }
    span {
      margin-top: 5px;
      font-size: 14px;
    }
  }
}
</style>
